home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-01-11 | 2.1 KB | 65 lines | [TEXT/CWIE] |
- // TNetworkServerApp.cp - Macintosh OpenTransport Network Server Application class object
- //
- // Apple Macintosh Developer Technical Support
- // Written by: Vinne Moscaritolo
- //
- // Copyright (work in progress) Apple Computer, Inc All rights reserved.
- //
- // You may incorporate this sample code into your applications without
- // restriction, though the sample code has been provided "AS IS" and the
- // responsibility for its operation is 100% yours. However, what you are
- // not permitted to do is to redistribute the source as "DSC Sample Code"
- // after having made changes. If you're going to re-distribute the source,
- // we require that you make it clear in the source that the code was
- // descended from Apple Sample Code, but that you've made changes.
- //
-
- #include "TNetworkServerApp.h"
- #include "TNetworkEventHandler.h"
- #include "TThread.h"
-
- // ---------------------------------------------------------------------------
- // TNetworkServerApp
- // ---------------------------------------------------------------------------
- // Default Constructor
-
- TNetworkServerApp::TNetworkServerApp()
- {
- ThrowIfOTErr( ::InitOpenTransport());
- fSleepTime = kNoSleep; // network task doesnt sleep
- }
-
- // ---------------------------------------------------------------------------
- // ~TNetworkServerApp
- // ---------------------------------------------------------------------------
- // Destructor
-
- TNetworkServerApp::~TNetworkServerApp()
- {
- };
-
-
- // ---------------------------------------------------------------------------
- // TNetworkServerApp::Start()
- // ---------------------------------------------------------------------------
- //
-
- void TNetworkServerApp::Start()
- {
- // handle any specific startup issues.
-
- TBackGroundApp::Start(); // call the inherited Start
- }
-
-
- // ---------------------------------------------------------------------------
- // TNetworkServerApp::DoIdle()
- // ---------------------------------------------------------------------------
- // process any network events durring idle time
-
- void TNetworkServerApp::DoIdle()
- {
- TNetworkEventHandler::ScanEventHandlerQueue();
- TThread::Yield();
- }
-